<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../css/bootstrap.css">
    <script src="../../js/jquery-1.11.2.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <style>
        body {
            padding: 50px
        }
      /*  .modal{
            display:block;
        }*/

    </style>

</head>
<body>
<h3>创建模态框</h3>
<!--data-backdrop 点击空白地方不关闭-->
<!--data-target 制定对象-->
<button class="btn btn-primary" data-toggle="modal" data-target="#pop-window" data-backdrop="static">
    弹出
</button>

<div class="modal fade"  id="pop-window">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <!--data-dismiss="modal" 隐藏相当与关闭-->
                <button class="close"  data-dismiss="modal">

                    &times;
                </button>
                <div class="modal-title">模拟提示框</div>
            </div>
            <div class="modal-body">
                成功提示
                成功提示
                成功提示
            </div>
            <div class="modal-footer">
                <button  class="btn btn-primary">确定</button>
                <button  class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<h1>用javascript方式触发</h1>
<button  class="btn btn-primary" id="btn">javascript</button>
</body>
<script>
    $(function () {
        $("#btn").on("click",function(){
            $("#pop-window").modal("show");
        });
       /* $("#btn2").on("click",function){
            $("#pop-window").modal("show");
        };*/
        /*$("#pop-window").modal();*/
    })
</script>
</html>
